public/io: xs_wire: Allow Xenstore to report EPERM
authorJulien Grall <jgrall@amazon.com>
Thu, 30 Jun 2022 18:37:34 +0000 (19:37 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 30 Jun 2022 18:37:54 +0000 (19:37 +0100)
commit8d578128393b9ee144b2c2deb4e0369556443686
tree7a57cf3477eee9825c28aa1174e9797bd5661a31
parent60d1adfa18793f4ddb70c8e901562d8d3e9be3dc
public/io: xs_wire: Allow Xenstore to report EPERM

C Xenstored is using EPERM when the client is not allowed to change
the owner (see GET_PERMS). However, the xenstore protocol doesn't
describe EPERM so EINVAL will be sent to the client.

When writing test, it would be useful to differentiate between EINVAL
(e.g. parsing error) and EPERM (i.e. no permission). So extend
xsd_errors[] to support return EPERM.

Looking at previous time xsd_errors was extended (8b2c441a1b), it was
considered to be safe to add a new error because at least Linux driver
and libxenstore treat an unknown error code as EINVAL.

This statement doesn't cover other possible OSes, however I am not
aware of any breakage.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
xen/include/public/io/xs_wire.h